package la.bbs558.entity.enums;

import lombok.Getter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author: Shanks
 * @date: 2023/12/16 17:59
 * @desc:
 */
@Getter
public enum UserSex {

    UNKNOWN(2, "未知"),
    MAN(1, "男"),
    WOMAN(0, "女");

    private final Integer code;

    private final String desc;

    UserSex(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static List<Map<String, Object>> getStateList() {
        List<Map<String, Object>> list = new ArrayList<>();
        for (UserSex value : UserSex.values()) {
            Map<String, Object> map = new HashMap<>(2);
            map.put("label", value.getDesc());
            map.put("value", value.getCode());
            list.add(map);
        }
        return list;
    }
}
